# Maintainer: Pim Otte <otte dot pim at gmail dot com>
pkgname=syncany
pkgver=0.4.3_alpha
_realver=0.4.3-alpha
pkgrel=1
pkgdesc="Cloud storage and filesharing application with a focus on security and abstraction of storage."
arch=(any)
url="http://www.syncany.org/"
license=('GPL3')
depends=('java-runtime>=7' 'bash-completion')
source=("http://syncany.org/dist/$pkgname-${_realver}.tar.gz"
        syncany)
sha256sums=('68116fbad41b0da2f3c0e77719ffca06ac49ed5cc22cae66014224b45c4a054c'
            'f1da57e49ac5c4a21e16fcba2514485e7590d3804f3072e832f5874c3f4928f6')

package() {
    install -Dm755 "syncany" "${pkgdir}/usr/bin/syncany"
    install -Dm644 "$srcdir/$pkgname-${_realver}/bash/syncany.bash-completion" "${pkgdir}/etc/bash_completion.d/syncany"

	cd "$srcdir/$pkgname-${_realver}/man/man"
    for man in *
    do
        install -Dm644 "$man" "${pkgdir}/usr/share/man/man1/$man"
        install -Dm644 "$man" "${pkgdir}/usr/share/man/man1/${man/sy/syncany}"
    done



	cd "$srcdir/$pkgname-${_realver}/lib"

    for jar in *
    do
        install -Dm644 "$jar" "${pkgdir}/usr/share/java/${pkgname}/$jar"
    done

    #Optional: symlink sy
    #ln -s /usr/bin/syncany ${pkgdir}/usr/bin/sy
}
